﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace Project_mfa
{
    public partial class LogIn : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            loginPanel.Visible = true;
            registerPanel.Visible = false;
        }

        protected void change_register(object sender, EventArgs e)
        {
            loginPanel.Visible = false;
            registerPanel.Visible = true;
        }

        protected void change_login(object sender, EventArgs e)
        {
            loginPanel.Visible = true;
            registerPanel.Visible = false;
        }

        protected void loginSystem_LoggedIn(object sender, EventArgs e)
        {
            if (Roles.IsUserInRole("Admin"))
            {
                loginSystem.DestinationPageUrl= "Admin.aspx";
                Response.Redirect("Admin.aspx");
            }
            else if (Roles.IsUserInRole("UserSchrijf"))
            {
                loginSystem.DestinationPageUrl = "User.aspx";
                Response.Redirect("User.aspx");
            }
        }
    }
}